package com.taurus.permanent.normal;

import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.taurus.permanent.data.Session;

public class UDPSessionTracker {
	private ConcurrentMap<String, Session> sessionsByOrigin = new ConcurrentHashMap<>();
	  
	  public Session getSession(String key) {
	    return this.sessionsByOrigin.get(key);
	  }
	  
	  public void storeSession(String key, Session session) {
	    this.sessionsByOrigin.put(key, session);
	  }
	  
	  public void remove(String key) {
	    this.sessionsByOrigin.remove(key);
	  }
	  
	  public Set<String> getKeys() {
	    return this.sessionsByOrigin.keySet();
	  }
}
